package org.geektimes.configuration.microprofile.config;

import org.eclipse.microprofile.config.spi.ConfigSource;

import java.util.Comparator;

/**
 * @author karidyang
 */
public class ConfigSourceComparator implements Comparator<ConfigSource> {
    private ConfigSourceComparator() {

    }
    private static final ConfigSourceComparator INSTANCE = new ConfigSourceComparator();

    public static ConfigSourceComparator getInstance() {
        return INSTANCE;
    }

    @Override
    public final int compare(ConfigSource o1, ConfigSource o2) {
        return Integer.compare(o1.getOrdinal(), o2.getOrdinal());
    }
}
